package com.yang.moyu.meta.system.service;

import com.yang.moyu.meta.system.domain.SysUser;
import com.yang.moyu.meta.system.vo.SysUserQueryVo;

import java.util.Map;

/**
 * Create by 10296 on 2021/12/16
 *
 * @Description:
 */
public interface SysUserService {

    /**
     * 保存
     *
     * @param sysUserVo
     * @return
     * @throws Exception
     */
    boolean saveSysUser(Map<String, Object> sysUserVo) throws Exception;

    /**
     * 修改
     *
     * @param paramsMap
     * @return
     * @throws Exception
     */
    boolean updateSysUser(Map<String, Object> paramsMap) throws Exception;

    /**
     * 删除
     *
     * @param paramsMap
     * @return
     * @throws Exception
     */
    boolean deleteSysUser(Map<String, Object> paramsMap) throws Exception;

    /**
     * 根据用户ID查询用户信息
     *
     * @param id
     * @return
     * @throws Exception
     */
    SysUserQueryVo getSysUserById(Long id) throws Exception;

    /**
     * 根据用户名查询用户信息
     *
     * @param username
     * @return
     * @throws Exception
     */
    SysUserQueryVo getSysUserByUsrName(String username) throws Exception;

    /**
     * @param paramMap
     * @return
     * @throws Exception
     */
    SysUser getSysUserByPwd(Map<String, Object> paramMap) throws Exception;

    /**
     * 根据用户名查询用户是否存在
     *
     * @param username
     * @return
     * @throws Exception
     */
    boolean isExistsByUsername(String username) throws Exception;

    /**
     * 检验部门和角色是否存在并且已启用
     *
     * @param departmentId
     * @param roleId
     * @throws Exception
     */
    void checkDepartmentAndRole(Long departmentId, Long roleId) throws Exception;

    /**
     * 通过角色ID判断是否存在可用用户ID
     *
     * @param roleId
     * @return
     * @throws Exception
     */
    boolean isExistsSysUserByRoleId(Long roleId) throws Exception;

    /**
     * 修改密码
     *
     * @param updatePasswordParam
     * @return
     * @throws Exception
     */
    boolean updatePassword(Map<String, Object> updatePasswordParam) throws Exception;

    /**
     * 修改头像
     *
     * @param id
     * @param headPath
     * @return
     * @throws Exception
     */
    boolean updateSysUserHead(Long id, String headPath) throws Exception;

    /**
     * 管理员重置密码
     *
     * @param resetPasswordParam
     * @return
     * @throws Exception
     */
    boolean resetPassword(Map<String, Object> resetPasswordParam) throws Exception;


}

